﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - Yan Forum CP</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="width=device-width" />
    @Styles.Render("~/Content/bootstrap")
    @Styles.Render("~/Content/cssadmin")
    @Scripts.Render("~/bundles/modernizr")
    <link href="/Content/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
</head>
<body>

    <div id="wrapper">

        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="@Url.Action("Index", "AccountAdmin", new { area = "Admin" })">Yan Forum Admin</a>
            </div>
            <!-- Top Menu Items -->
            <ul class="nav navbar-right top-nav">
                <li class="dropdown">
                    @{
                        var membership = (WebMatrix.WebData.SimpleMembershipProvider)Membership.Provider;
                        int idUser = membership.GetUserId(User.Identity.Name);

                        var getUserCurent = YanForum.Engine.Services.Account.GetUserByUserId(idUser);
                    }
                    <a href="@Url.Action("Manage", "Account", new { area = "" })" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i>  @getUserCurent.FullName<b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="@Url.Action("Index", "AccountAdmin", new { area = "Admin" })"><i class="fa fa-fw fa-user"></i>Cập nhật thông tin</a>
                        </li>
                        <li>
                            <a href="@Url.Action("Manage", "AccountAdmin", new { area = "Admin" })"><i class="fa fa-fw fa-user"></i>Thay đổi mật khẩu</a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            @using (Html.BeginForm("LogOff", "Account", new { area = "" }, FormMethod.Post, new { id = "logoutForm" }))
                            {
                                @Html.AntiForgeryToken()
                            }
                            <a href="javascript:document.getElementById('logoutForm').submit()"><i class="fa fa-fw fa-power-off"></i>Thoát</a>
                        </li>
                    </ul>
                </li>
            </ul>
            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
            @{
                string pathCurrent = Request.Url.AbsolutePath;
                string dasboard = Url.Action("Manage", "AccountAdmin", new { area = "Admin" });
                string userInfo = Url.Action("Index", "AccountAdmin", new { area = "Admin" });
                string manageUser = Url.Action("ManageAccount", "AccountAdmin", new { area = "Admin" });
                string post = Url.Action("Index", "Post", new { area = "Admin"});
                string comment = Url.Action("Index", "CommentAdmin", new { area = "Admin"});
            }
            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav side-nav">
                    <li class="@(pathCurrent == dasboard ? "active" : "")">
                        <a class="menu-item" href="@dasboard"><i class="fa fa-fw fa-dashboard"></i>Dashboard</a>
                    </li>
                    <li class="@(pathCurrent == userInfo ? "active" : "")">
                        <a class="menu-item" href="@userInfo"><i class="fa fa-fw fa-user"></i>Thông tin cá nhân</a>
                    </li>
                    @if (User.IsInRole(YanForum.Engine.ViewModels.UserRoles.Admin))
                    {
                        <li class="@(pathCurrent == manageUser ? "active" : "")">
                            <a class="menu-item"  href="@manageUser"><i class="fa fa-fw fa-user"></i>Quản lý tài khoản</a>
                        </li>
                    }                    
                    <li class="@(pathCurrent == post ? "active" : "")">
                        <a class="menu-item" href="@post"><i class="fa fa-fw fa-edit"></i>Quản lý bài viết</a>
                    </li>
                    @if (User.IsInRole(YanForum.Engine.ViewModels.UserRoles.Admin))
                    {
                        <li class="@(pathCurrent == comment ? "active" : "")">
                            <a class="menu-item"  href="@comment"><i class="fa fa-fw fa-edit"></i>Quản lý comment (<span id="countAllComment" title ="Có 0 comment đang chờ duyệt">0</span>)</a>
                        </li>
                    }
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </nav>

        <div id="page-wrapper">
            <div class="container-fluid">
                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">
                            @ViewBag.Title
                        </h1>
                        <ol class="breadcrumb">
                            <li class="active">
                                <i class="fa fa-dashboard"></i> @ViewBag.Title
                            </li>
                        </ol>
                    </div>
                </div>

                @RenderBody()
            </div>
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @Scripts.Render("~/bundles/common_admin")
    @RenderSection("scripts", required: false)
</body>
</html>
